﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LTSMZ.life.DAL;
using LTSMZ.life.Model;

namespace LTSMZ.life.BLL
{
    public  class OrdersBll
    {
        OrdersDal dal = new OrdersDal();
        /// <summary>
        /// 显示订单
        /// </summary> 
        /// <returns></returns>
        public List<OrdersComment> Ordersshow()
        {
            return dal.Ordersshow();
        }
        /// <summary>
        /// 添加到订单
        /// </summary>
        /// <param name="o">订单集合</param>
        /// <param name="users">当前用户名编号</param>
        /// <param name="Mname">当前商品编号</param>
        /// <param name="Rid">当前地址编号</param>
        /// <returns></returns>
        //public int OrdersAdd(Orders o, int users, int Mname, int Rid)
        //{
        //    return dal.OrdersAdd(o, users, Mname, Rid);
        //}
        /// <summary>
        /// 删除订单
        /// </summary>
        /// <param name="id">订单Id</param>
        /// <returns></returns>
        public int OrdersDel(int id)
        {
            return dal.OrdersDel(id);
        }
        /// <summary>
        /// 订单查询
        /// </summary>
        /// <param name="OrderID">当前订单编号</param>
        /// <returns></returns>
        public List<OrdersComment> OrdersShowCha(int OrderID)
        {
            return dal.OrdersShowCha(OrderID);
        }
        /// <summary>
        /// 根据编号获取订单信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        //public Orders GetOrderId(int id)
        //{
        //    return dal.GetOrderId(id);
        //}
         /// <summary>
        /// 添加订单子表
        /// </summary>
        /// <param name="order"></param>
        /// <param name="xml"></param>
        /// <returns></returns>
        public int InsertOrderSon(Orders order, string xml)
        {
            return dal.InsertOrderSon(order, xml);
        }

        /// <summary>
        /// 订单显示
        /// </summary>
        /// <returns></returns>
        public List<Orders> ShowOrders(string name)
        {
            return dal.ShowOrders(name);
        }
    }
}
